@extends('layouts.back_stage')
@section('content')
    <style>
     ::-webkit-scrollbar {height: 8px;}
     [v-cloak] {display: none;}
    .input-item{width:180px;padding-right: 0;margin-right:10px;}
    .touching{float:right;margin-right:10px;}
    .spTip{width:20px;height:20px;display:inline-block;margin:0 5px 0 20px;}
    .tableBg{padding:20px;background:#fff;margin-top:10px;}
    .shopBg{background:#fff;overflow: hidden;margin:10px 0 10px 0;}
    .pagination_centent{text-align:center;margin-top:5px}
    .selent{width:100%}
    .el-table tr:hover>td{background:initial !important;}
    .el-table tr.current-row>td{background:initial !important;}
    .el-form-item__label{font-size:12px;}
    .el-table--small th {padding:0px}
    .el-table th.is-leaf{padding:3px}
    .el-form--inline .el-form-item__label {text-align: end;}
    .el-table tr:hover>td{background:initial !important;}
  .el-table tr.current-row>td{background:initial !important;}
  .el-table__expanded-cell[class*=cell]{padding:0 !important;}
  .el-table--striped .el-table__body tr.el-table__row--striped.current-row td, .el-table__body tr.current-row>td, .el-table__body tr.hover-row.current-row>td, .el-table__body tr.hover-row.el-table__row--striped.current-row>td, .el-table__body tr.hover-row.el-table__row--striped>td, .el-table__body tr.hover-row>td{background:initial !important;}
  
    .el-tabs--border-card>.el-tabs__content{padding:0px}
    .demo-table-expand {
    font-size: 0;
  }
  .demo-table-expand label {
    width: 90px;
    color: #99a9bf;
  }
  .demo-table-expand .el-form-item {
    margin-right: 0;
    margin-bottom: 0;
    width: 25%;
  }
  .el-table .warning-row {
    background: #67c34a;

  }

  .el-table .success-row {
    background: #fff;
  }
    </style>
    <div class="container">
        <div style="padding:20px 20px 10px 0;overflow:hidden;"><h3 style="float:left;">到货入仓</h3></div>
        <!-- 主体-->
        <div class="page-body">
            <div class="row app" id="guanLi" v-cloak>
                <el-button type="primary" class="touching"  @click='check' style="margin-right:40px" size="small">仓库审核</el-button>
                <div class="col-md-12 row row-table-box">
                    <div class="shopBg">
                        <div class="row" style="margin-top:10px;padding:9px 30px;background:#fff;">
                    <label>加工厂：</label>
                            <el-autocomplete class="inline-input" v-model="supplier"  :fetch-suggestions="querySearch" placeholder="请输入加工厂" size="small" :trigger-on-focus="false"   @select="handleSelect" > </el-autocomplete>      
                     <label>单据号：</label>
                            <el-input class="input-item"  v-model="receipts" placeholder="请输入单据号" size="small" prefix-icon="el-icon-search" clearable></el-input>
                            <div style="display:inline-block;padding:10px 0;">
                                <label>选择时间：</label>
                                <el-date-picker v-model="tiem" type="daterange" size="small" value-format="yyyy-MM-dd" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
                                <el-button type="primary" style="margin-left:10px" @click="seek" size="small" >搜索</el-button>
                                <el-button  @click="reacter" type="primary"  size="small">重置</el-button>
                            </div>
                        </div>
                    </div>
                   <div>
                   <!-- 新增仓库对话框 -->
                        <el-dialog  title="仓库" :visible.sync="Visible" width="25%" :before-close="handleClose">
                            <el-select  size="small" class="selent" v-model="aelect_type" @change="typeValue">
                                <el-option  v-for="itme in opt"  :key="itme.id" :value="itme.id" :label="itme.type">@{{itme.type}} </el-option>     
                            </el-select>
                              <span slot="footer" class="dialog-footer">
                                <el-button size="small" @click="Visible = false">取 消</el-button>
                                <el-button size="small" type="primary" @click="addNew">确 定</el-button>
                            </span>
                        </el-dialog>
                     </div> 
                    <div class="tableBg borderBg">
                        <p style="height:20px;line-height:20px;display: inline-flex;float: right;">
                            <span class="spTip" style="background:#fff;border:1px solid #ccc"></span>仓库未审核
                            <span class="spTip" style="background:#67c34a;"></span>仓库已审核
                        </p>
                        <!-- 表1  -->
                    <template>
                            <el-table  :data="tableData" border  :resizable='false' @filter-change="filterTag" :row-class-name="tableRowClassName" size="small" @cell-click="clickTab" @selection-change="handleSelectionChange" style="width: 100%">
                            <el-table-column type="expand">
      <template slot-scope="props">
        <el-form label-position="left" inline class="demo-table-expand">
          <el-form-item label="扫描人:">
            <span>@{{ props.row.scaned_by }}</span>
          </el-form-item>
          <el-form-item label="扫描时间:">
            <span>@{{ props.row.scaned_at }}</span>
          </el-form-item>
          <el-form-item label="审核人:">
            <span>@{{ props.row.verified_by }}</span>
          </el-form-item>
          <el-form-item label="审核时间:">
            <span>@{{ props.row.verified_at }}</span>
          </el-form-item>
          <el-form-item label="确认人:">
            <span>@{{ props.row.created_by }}</span>
          </el-form-item>
          <el-form-item label="确认时间:">
            <span>@{{ props.row.created_at }}</span>
          </el-form-item>
          <el-form-item label="备注:">
            <span>@{{ props.row.remark }}</span>
          </el-form-item>
        </el-form>
      </template>
    </el-table-column>    
                            <el-table-column type="selection" :resizable='false'  align="center"  width="50"> </el-table-column>
                            <el-table-column prop="no" align="center" :resizable='false'  min-width="140" label="单据号"  ></el-table-column>
                            <el-table-column prop="supplied_by" align="center"  :resizable='false'  min-width="100" label="加工厂" ></el-table-column>
                            <el-table-column  prop="warehouse" align="center"  :resizable='false' width="120" label="收货仓库" 
                                                  column-key="entrepot" :filters="entrepot"> 
                            </el-table-column>
                            <el-table-column  prop="num_a" align="center" :resizable='false'  label="计划数量/件"  width="120" > </el-table-column> 
                            <el-table-column  prop="num_b" align="center" :resizable='false'  label="扫描数量/件"  width="120" > </el-table-column> 
                            <!-- <el-table-column prop="scaned_by" align="center" :resizable='false'  label="扫描人"  width="100"></el-table-column>
                            <el-table-column prop="scaned_at" align="center"  :resizable='false' label="扫描时间" width="160" > </el-table-column>
                            <el-table-column  prop="verified_by"  align="center" :resizable='false'  label="仓库审核人"  width="100" > </el-table-column>
                            <el-table-column  prop="verified_at"  align="center" :resizable='false'  width="160" label="仓库审核时间"  ></el-table-column> -->
                            
                            <el-table-column  prop="verified_at" align="center" :resizable='false' width="120" label="审核状态" 
                                              column-key="verified_at" :filters="[{ text: '未审核', value: '2' }, { text: '已审核', value: '1' }]" > 
                                <template slot-scope="scope">
                                    <span v-if="scope.row.verified_at==null"  class="updata" >未审核</span>
                                    <span v-if="scope.row.verified_at!=null"   class="updata">已审核</span>
                                </template>
                            </el-table-column>
                            <el-table-column  prop="scaned_at" align="center" :resizable='false' label="扫描状态" width="120"
                                              column-key="scaned_at" :filters="[{ text: '未扫描', value: '2' }, { text: '已扫描', value: '1' }]" > 
                            <template slot-scope="scope">
                                    <span v-if="scope.row.scaned_at==null" class="updata" >未扫描</span>
                                    <span v-if="scope.row.scaned_at!=null"  class="updata">已扫描</span>
                            </template>
                            </el-table-column>
                            <el-table-column  label="操作" align="center" :resizable='false' fixed="right"  width="100">
                                <template slot-scope="scope">
                                     <el-button type="text" v-if="scope.row.scaned_at==null" @click="scan(scope)" size="small">扫描</el-button>
                                     <el-button type="text"  v-if="scope.row.scaned_at!=null" @click="scan_a(scope)" size="small">查看</el-button>
                                </template>
                                </el-table-column>
                            </el-table>
                            <!-- 分页 -->
                            <div class="pagination_centent">
                               <el-pagination background layout="prev, pager, next" @current-change="handleCurrentChange"  :total="total">
                                </el-pagination>
                            </div>
                     </template>
                    </div>
                    <!-- 表下面的tabs -->
                    <div class="tableBg">
                       <el-tabs type="border-card">
                           <el-tab-pane label="单据明细">
                        <el-table :data="tableData_1" border size="small" :resizable='false' style="width: 100%">
                         <el-table-column prop="year" align="center" label="年份"  :resizable='false' width="70"  >  </el-table-column>
                             <el-table-column prop="season"  align="center"  :resizable='false' label="季节" width="60"> </el-table-column>
                            <el-table-column prop="species"  align="center" :resizable='false'  label="类型" width="100" > </el-table-column>
                            <el-table-column  prop="girard" align="center" :resizable='false' label="款号" min-width="120" > </el-table-column>
                            <el-table-column prop="color"  align="center" :resizable='false' label="颜色" min-width="80" >  </el-table-column>
                            <el-table-column  prop="price" align="center"  :resizable='false' label="吊牌价/元" width="90" ></el-table-column>
                            <el-table-column v-for="(item ,index) in sizeGr"  :key="index"  :label="item.key76" width="70" align="center" :resizable='false'>
                                <el-table-column :label="item.key75" width="70" :resizable='false' align="center" >
                                    <el-table-column :label="item.key79" width="70" :resizable='false' align="center" >
                                        <el-table-column :label="item.key154" width="70" :resizable='false'  align="center">
                                            <el-table-column :label="item.key146" width="70" :resizable='false'  align="center">
                                                <el-table-column :label="item.key161" width="70" :resizable='false'  align="center">
                                                    <el-table-column :label="item.key77" width="70" :resizable='false'  align="center">
                                                        <el-table-column :prop="item.key_0" :label="item.key140" width="75" :resizable='false'  align="center"></el-table-column>
                                                    </el-table-column>
                                                </el-table-column>
                                            </el-table-column>
                                        </el-table-column>
                                    </el-table-column>
                                </el-table-column>
                            </el-table-column>
                        </el-tab-pane>
                        <el-tab-pane label="单据清单">
                          <el-table :data="tableData3" border size="small"  style="width: 100%">
                            <el-table-column type="index" align="center"  :resizable='false' label="序号" width="55" > </el-table-column>
                            <el-table-column prop="year"  align="center"  :resizable='false' label="年份" width="120" > </el-table-column>
                            <el-table-column prop="season" align="center"  :resizable='false'  label="季节" width="100" > </el-table-column>
                            <el-table-column  prop="cate" align="center" :resizable='false'  label="类型" width="100" > </el-table-column>
                            <el-table-column  prop="girard"  align="center" :resizable='false'  label="款号" > </el-table-column>
                            <el-table-column prop="color"  align="center"  :resizable='false' label="颜色" width="100" > </el-table-column>
                            <el-table-column  prop="price" align="center" :resizable='false'  label="吊牌价"  width="80" ></el-table-column>
                            <el-table-column prop="size" align="center" :resizable='false'  label="尺寸"  width="60"  > </el-table-column>
                            <el-table-column prop="code"  align="center"  :resizable='false'  label="服装条码"  min-width="130"> </el-table-column>
                            <el-table-column  prop="founder" align="center" :resizable='false' label="扫描人"  width="80" > </el-table-column> 
                            <el-table-column prop="scaned_at" align="center" :resizable='false'  label="扫描时间" min-width="130" > </el-table-column>
                         </el-table>
                            </el-tab-pane>
                     </el-tabs>
                    </div>
                </div>
            </div>
        </div>
        <!-- /主体-->
    </div>
    <script>
        new Vue({
            el: '#guanLi',
            data:{
                Visible:false,//新增对话框
                tableData_1:[],
                opt:[],//新增对话框里面的下拉
                aelect_type:'',//下拉内容
                total:1,//
                size:[],//尺码
                tiem:'',//时间选择
                receipts:'',// 单据号
                supplier:'',//供应商
                entrepot_a:'',//tab下拉仓库搜索用
                verified_at:'',//tab下拉状态用
                scaned_at:'',//
                verifiedId:'',//审核状态
                current_page:1,//
                tableData: [],
                tableData2: [],
                tableData3: [],
                role:'',
                entrepot:[],//用来装tab里下拉仓库的
                sizeGr:[],//tab2 尺码
                chekboxId:[],//多选框id
                chekboxStatus:[],//多选框状态
            },
            created(){
               
            },
            mounted(){
              this.refurbish();
              this.demand();
              this.common();
            },
            methods:{
                querySearch(queryString, cb) {
                        let self = this
                        $.ajax({
                        headers: { 'X-CSRF-TOKEN': $('meta[name="csrf_token"]').attr('content')},
                        type: 'get',
                        dataType:'json',
                        url: '/supplier/index/',
                        data:{
                            name:this.supplier
                        },
                        success:function(res){
                            if(res.result.success){
                                var results=[];
                                for(var i=0;i<res.content.data.length;i++){
                                    results.push({
                                        'value':res.content.data[i].name,
                                        'id':res.content.data[i].id
                                    })
                                }
                                clearTimeout(this.timeout);
                                this.timeout = setTimeout(() => {
                                    cb(results);
                                }, 2000 * Math.random());
                                $(".el-autocomplete-suggestion.el-popper.is-loading").show();
                            }else{
                                self.$notify.error({
                                    title: '提示',
                                    message: res.result.errorMsg,
                                });
                            }
                        }
                    })
              },
             //下拉选择之后的值
      handleSelect(item) {
          this.role=item.id
      },
                // 仓库审核
                check(){
                    let that=this
                    if(this.chekboxId==''){
                        this.$notify.error({
                                title: '提示',
                                message: '请选择你要审核的项',
                            });
                            return false;
                     } 
                if(this.chekboxId.length==1){
                     if(this.chekboxStatus==1){
                        this.$notify.error({
                                title: '提示',
                                message: '你选择的项已经审核了',
                            });
                     }else{
                        this.Audit();
                     }
                }else{
                   for(var i in this.chekboxStatus){
                        if(this.chekboxStatus[i]==1){
                            this.$notify.error({
                                title: '提示',
                                message: '你选择的项有已经审核了',
                            });
                            return false;
                        }
                   }
                   for(var e in this.chekboxStatus){
                       if(this.chekboxStatus[i]==0){
                        this.Audit();
                       }
                       return false;
                   }
                }  

                },
                // 多选框事件
                handleSelectionChange(val){
                   
                    this.chekboxId=[]
                    this.chekboxStatus=[]
                    for(var e in val){
                        this.chekboxId.push(val[e].id)
                        this.chekboxStatus.push(val[e].verifiedId)
                    }
                },
                //仓库审核调用数据
                Audit(){
                    let that=this
                    $.ajax({
                            headers: { 'X-CSRF-TOKEN': $('meta[name="csrf_token"]').attr('content')},
                            type:'post',
                            url:'/distribute/deliver/verify',
                            dataType:'json',
                            data:{
                                id:this.chekboxId
                            },
                        }).then(function(res){
                            if(res.result.success==true){
                                 that.$notify.success({
                                    title: '提示',
                                    message: '审核提交成功',
                                 });
                             that.refurbish();
                            }else{
                                that.$notify.error({
                                    title: '错误',
                                    message: res.result.errorMsg
                                    });
                             }
                        })  
                },
                //导出
                derive(){
                    if(this.chekboxId==''){
                        this.$notify.error({
                        title: '提示',
                        message: '请选择你要审核的项',
                         });
                       return false;
                     }
                },
                //  点击tab1 获得行的数据
                clickTab(row){
                    let that=this
                    var tab2=[]
                    var tab3=[]
                    $.ajax({
                            headers: { 'X-CSRF-TOKEN': $('meta[name="csrf_token"]').attr('content')},
                            type:'get',
                            url:`/distribute/deliver/statistic/${row.id}`,
                            dataType:'json',
                        }).then(function(res){
                           if(res.content.goods!=''){
                               for(var e in res.content.goods){
                                   tab3.push({
                                      'year': res.content.goods[e].year,
                                      'season':res.content.goods[e].season,
                                      'girard':res.content.goods[e].girard,
                                      'color':res.content.goods[e].color,
                                      'price':res.content.goods[e].price,
                                      'size':res.content.goods[e].size,
                                      'code':res.content.goods[e].code,
                                      'founder':res.content.goods[e].founder,
                                      'cate':res.content.goods[e].cate,
                                      'scaned_at':res.content.goods[e].scaned_at
                                   })
                                 
                               }
                                that.tableData3=tab3
                           }
                            if(res.content.item!=''){
                                 for(var k in res.content.item){
                                    if(res.content.item[k].price.length!=1){
                                        res.content.item[k].price=res.content.item[k].price[0]+'/'+res.content.item[k].price[1]
                                    }
                                    for(var e in res.content.item[k].bsize){
                                        if(res.content.item[k].bsize[e]==0){
                                            res.content.item[k].bsize[e]=''
                                        }
                                    }
                                     tab2.push({
                                         'year':res.content.item[k].year,
                                         'season':res.content.item[k].season,
                                         'species':res.content.item[k].species,
                                         'girard':res.content.item[k].girard,
                                         'price':res.content.item[k].price,
                                         'size_group':res.content.item[k].cate,
                                          'color':res.content.item[k].colorr,
                                         'num':res.content.item[k].bsize
                                     })
                                 }     
                              that.tableData_1=tab2
                            }
                        })
                },
                /*尺码数据*/
                common(){
                    var that=this;
                    $.ajax({
                        headers: {
                            'X-CSRF-TOKEN': $('meta[name="csrf_token"]').attr('content')
                        },
                        type: 'post',
                        url: '/distribution/sizeGroupHead',
                        data: {
                            type:1,
                        },
                        success: function (data) {
                            if(data.result.success){
                                that.sizeGr=data.content.vertical;
                            }else{
                                that.$notify.error({
                                    title: '提示',
                                    message: data.result.errorMsg,
                                });
                            }
                        }
                    });
                },
               // 搜索
             seek(){
                    if(this.tiem=='' && this.receipts=='' && this.supplier==''){
                        this.$notify.error({
                                title: '提示',
                                message: '请输入要搜索的内容',
                            });
                            return false;
                        }
                let that=this
                var list=[]
                var aa=''
                var num_b1=''
                    $.ajax({
                    headers: { 'X-CSRF-TOKEN': $('meta[name="csrf_token"]').attr('content')},
                    type:'get',
                    url:'/distribute/deliver/index',
                    dataType:'json',
                    data:{
                        type:'1',
                        current_page:this.current_page ,
                        receipts:this.receipts,
                        role:this.role,
                        time:this.tiem,
                        entrepot_a:this.entrepot_a,
                        verified:this.verified_at,
                        scaned:this.scaned_at,
                    }
                }).then(function(res){
                    if(res.content.data!=null){
                    res.content.current_page =that.current_page 
                    that.total=res.content.total
                    var i=-1
                   for(var e in res.content.data){
                       i++
                    if(res.content.data[e].warehouse==null){
                        res.content.data[e].warehouse=''
                    }  
                    if(res.content.data[e].scaned_by==-1){
                        res.content.data[e].scaned_by=''
                    }    
                    if(res.content.data[e].verified_by==-1){
                        res.content.data[e].verified_by=''
                    }  
                    if(res.content.data[e].confirmed_by==-1){
                        res.content.data[e].confirmed_by=''
                    } 
                    if(res.content.data[e].created_by==-1){
                        res.content.data[e].created_by=''
                    } 
                    if(res.content.data[e].verified_at==null ||res.content.data[e].verified_at==-1){
                        aa=0;
                    }else{
                        aa=1;
                    }   
                    if(res.content.data[e].stocks==''){
                        num_b1=0
                    }   
                    for(var x in res.content.data[e].stocks){
                        num_b1=res.content.data[e].stocks[x].number
                    } 
                       list.push({
                           'id':res.content.data[e].id,
                           'pootr':i+(1*that.current_page),
                            'no':res.content.data[e].no,
                            'warehouse':res.content.data[e].warehouse.type,
                            'status':res.content.data[e].status,
                            'remark':res.content.data[e].remark,
                            'scaned_at':res.content.data[e].scaned_at,
                            'scaned_by':res.content.data[e].scaned_by,
                            'verified_at':res.content.data[e].verified_at,
                            'verified_by':res.content.data[e].verified_by,
                            'confirmed_at':res.content.data[e].confirmed_at,
                            'confirmed_by':res.content.data[e].confirmed_by,
                            'created_at':res.content.data[e].created_at,
                            'created_by':res.content.data[e].created_by,
                            'supplied_by':res.content.data[e].supplied_by,
                            'verifiedId':aa,
                            'num_a':res.content.data[e].original,
                            'num_b':num_b1
                       })
                    }
                   that.tableData=list
                    }else{
                        that.$notify.error({
                                    title: '提示',
                                    message: '未找到你要查找的内容',
                              });
                      }
                })
              
                },
                //重置
            reacter(){
                    this.tiem=''
                    this.receipts=''
                    this.supplier=''
                    this.refurbish();
                },
                //点击页数
             handleCurrentChange(val){
                    this.current_page=val
                    this.refurbish();
                },
                 //点击tab下拉
             filterTag(value){
                       if(value.verified_at!=undefined){
                            var val1=value.verified_at;
                            var stas1='';
                            for(let i=0; i<val1.length;i++){
                                stas1=stas1+val1[i]+',';
                            } 
                            this.verified_at=stas1.substr(0, stas1.length - 1);
                            this.refurbish(); 
                        }
                        if(value.scaned_at!=undefined){
                            var val1=value.scaned_at;
                            var stas1='';
                            for(let i=0; i<val1.length;i++){
                                stas1=stas1+val1[i]+',';
                            } 
                            this.scaned_at=stas1.substr(0, stas1.length - 1);
                            this.refurbish(); 
                        }
                     if(value.entrepot!=undefined){
                            var val1=value.entrepot;
                            var stas1='';
                            for(let i=0; i<val1.length;i++){
                                stas1=stas1+val1[i]+',';
                            } 
                            this.entrepot_a=stas1.substr(0, stas1.length - 1);
                            this.refurbish(); 
                        }
                 },
                //表里的row颜色
                tableRowClassName({row, rowIndex}) {
                        if (row.verifiedId === 1) {
                        return 'warning-row';
                        } else if (row.verifiedId === 0) {
                        return 'success-row';
                        }
                        return '';
                    },
                // 扫描
              scan(scope){
                    window.location.href=`/distribute/deliver/scanpage/${scope.row.id}`;
               },
                 // 点击查看
              scan_a(scope){
                   window.location.href=`/distribute/deliver/scanpage/${scope.row.id}/a`;
               },
               //对话框上面的X
               handleClose(done) {
                    this.Visible=false
               },
               //点击新增弹出对话框
               addEntrepot(){
                this.Visible=true
                this.aelect_type=''
                this.demand();
               },
               // 新增仓库下拉选中之后的返回值
               typeValue(val){
                   let that=this
                   this.aelect_type=val
                   this.Visible=false
                   that.refurbish();
               },
               //对话框弹出时请求仓库
               demand(){
                let that=this
                        $.ajax({
                        headers: { 'X-CSRF-TOKEN': $('meta[name="csrf_token"]').attr('content')},
                        type:'get',
                        url:'/distribute/warehouse/index',
                        dataType:'json',
                    }).then(function(res){
                        that.opt=res.content
                        for(var e in that.opt){
                            that.entrepot.push({
                                text:that.opt[e].type,
                                value:that.opt[e].id,
                            })
                        }
                    })
               },
               //新增对话框提交
              addNew(){
                let that=this
                    $.ajax({
                            headers: { 'X-CSRF-TOKEN': $('meta[name="csrf_token"]').attr('content')},
                            type:'post',
                            url:'/distribute/deliver/addreceipt/',
                            dataType:'json',
                            data:{
                                type:this.aelect_type
                            }
                        }).then(function(res){
                            
                            that.Visible=false
                            that.refurbish();
                        })
                },
                //tab
            refurbish(){
                let that=this
                var list=[]
                var aa=''
                var num_b1=''
                    $.ajax({
                    headers: { 'X-CSRF-TOKEN': $('meta[name="csrf_token"]').attr('content')},
                    type:'get',
                    url:'/distribute/deliver/index',
                    dataType:'json',
                    data:{
                        type:'1',
                        current_page:this.current_page ,
                        receipts:this.receipts,
                        role:this.role,
                        time:this.tiem,
                        entrepot_a:this.entrepot_a,
                        verified:this.verified_at,
                        scaned:this.scaned_at,
                    }
                }).then(function(res){
                    res.content.current_page =that.current_page 
                    that.total=res.content.total
                    var i=-1
                   for(var e in res.content.data){
                       i++
                    if(res.content.data[e].warehouse==null){
                        res.content.data[e].warehouse=''
                    }  
                    if(res.content.data[e].scaned_by==-1){
                        res.content.data[e].scaned_by=''
                    }    
                    if(res.content.data[e].verified_by==-1){
                        res.content.data[e].verified_by=''
                    }  
                    if(res.content.data[e].confirmed_by==-1){
                        res.content.data[e].confirmed_by=''
                    } 
                    if(res.content.data[e].created_by==-1){
                        res.content.data[e].created_by=''
                    } 
                    if(res.content.data[e].verified_at==null ||res.content.data[e].verified_at==-1){
                        aa=0;
                    }else{
                        aa=1;
                    }   
                    if(res.content.data[e].stocks==''){
                        num_b1=0
                    }   
                    for(var x in res.content.data[e].stocks){
                        num_b1=res.content.data[e].stocks[x].number
                    } 
                       list.push({
                           'id':res.content.data[e].id,
                           'pootr':i+(1*that.current_page),
                            'no':res.content.data[e].no,
                            'warehouse':res.content.data[e].warehouse.type,
                            'status':res.content.data[e].status,
                            'remark':res.content.data[e].remark,
                            'scaned_at':res.content.data[e].scaned_at,
                            'scaned_by':res.content.data[e].scaned_by,
                            'verified_at':res.content.data[e].verified_at,
                            'verified_by':res.content.data[e].verified_by,
                            'confirmed_at':res.content.data[e].confirmed_at,
                            'confirmed_by':res.content.data[e].confirmed_by,
                            'created_at':res.content.data[e].created_at,
                            'created_by':res.content.data[e].created_by,
                            'supplied_by':res.content.data[e].supplied_by,
                            'verifiedId':aa,
                            'num_a':res.content.data[e].original,
                            'num_b':num_b1
                       })
                    }
                   that.tableData=list
                })
              },
            
            }
        });
    </script>
@endsection